﻿<local:BasePage 
    x:Class="InTREPWP.Views.Detalhes"
    xmlns:local="clr-namespace:InTREPWP.Views"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DataContext="{d:DesignData ../SampleData/MainViewModelSampleData.xaml}"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait" 
    shell:SystemTray.IsVisible="True"
    Style="{StaticResource TransitionPageStyle}">

    <Grid x:Name="LayoutRoot" Background="Transparent" d:DataContext="{Binding Items[0]}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <controls:Pivot x:Name="pivot" Grid.Row="0" Title="INTREP" SelectionChanged="Pivot_SelectionChanged">
            <controls:PivotItem Header="detalhes">
                <StackPanel x:Name="stkDetalhes">
                    <TextBlock x:Name="txtLblNavio" Text="Navio" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                    <TextBlock x:Name="txtNavio" Text="{Binding Navio}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                    <TextBlock x:Name="txtLblDestino" Text="Destino" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                    <TextBlock x:Name="txtDestino" Text="{Binding Destino}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                    <TextBlock x:Name="txtLblData" Text="Data" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                    <TextBlock x:Name="txtData" Text="{Binding DataInicial, StringFormat='dd/MM/yyyy'}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                    <TextBlock x:Name="txtLblProduto" Text="Produto" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                    <TextBlock x:Name="txtProduto" Text="{Binding Produto}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Concluido" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                        <TextBlock x:Name="txtLblConcluido" Text="{Binding Concluido}" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                        <TextBlock Text="%" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                    </StackPanel>
                    <ProgressBar x:Name="pgrConcluido" Value="{Binding Concluido}" ></ProgressBar>
                </StackPanel>
            </controls:PivotItem>

            <controls:PivotItem Header="itens">
                <StackPanel x:Name="stkItens">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="re" Width="50" Style="{StaticResource PhoneTextGroupHeaderStyle}"></TextBlock>
                        <TextBlock Text="qtd" Width="100"  Style="{StaticResource PhoneTextGroupHeaderStyle}"></TextBlock>
                        <TextBlock Text="exportador"  Style="{StaticResource PhoneTextGroupHeaderStyle}"></TextBlock>
                    </StackPanel>
                    <ListBox x:Name="lstItens" ItemsSource="{Binding Itens}" DataContext="{Binding}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding RE}" Width="50" Style="{StaticResource PhoneTextNormalStyle}"></TextBlock>
                                    <TextBlock Text="{Binding Quantidade}" Width="100" Style="{StaticResource PhoneTextNormalStyle}"></TextBlock>
                                    <TextBlock Text="{Binding Path=Exportador.Nome}"  Style="{StaticResource PhoneTextNormalStyle}"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </controls:PivotItem>
        </controls:Pivot>
        <toolkit:PerformanceProgressBar x:Name="progressBar" Grid.Row="1" IsIndeterminate="True" Visibility="Collapsed"/>
    </Grid>

    <local:BasePage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.pause.png" Text="pausar" Click="ApplicationBarPause_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.play.png" Text="parar" Click="ApplicationBarContinuar_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.email.png" Text="mensagem" Click="ApplicationBarEmail_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="sobre" Click="ApplicationBarMenuSobre_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </local:BasePage.ApplicationBar>

</local:BasePage>